package com.xtkj.finance.mapper.dysql;

import org.apache.ibatis.jdbc.SQL;
import com.xtkj.finance.vo.SysRole;

public class SysRoleMapperSql {
	public String addOneRole(SysRole role) {
		String sql = new SQL()
				.INSERT_INTO("sys_role")
				.VALUES("id, name, e_name ", "#{id}, #{name}, #{eName}")
				.VALUES("create_by, create_date", "#{createBy}, default")
				.VALUES("remarks, del_flag", "#{remarks}, default")
				.toString();
		return sql;
	}
	
	public String updateRole(SysRole role) {
		String sql = new SQL().
				UPDATE("sys_role")
				.SET("name = #{name}","e_Name = #{eName}")
				.SET("update_by = #{updateBy}","update_date = sysdate","remarks = #{remarks}")
				.WHERE("id = #{id} and update_date = #{updateDate}")
				.toString();
		return sql;
	}
}
